package com.example.exersice;

import java.util.Scanner;

/**
 * Created by venus on 11/09/14.
 */
public class DrawRightTriangle {
    public static void main(String[] args) {

        System.out.println("How many asterisks would you like? (Please enter a number) ");
        int numberOfAsterisks;

        //Read number of asterisks
        Scanner input = new Scanner(System.in);

        //Check if the number is valid
        try {
            numberOfAsterisks = input.nextInt();
        } catch (Exception e) {
            System.out.println("Wrong number. Please try again.");
            return;
        }

        //printout number of asterisks
        String asterisksInRow = "";
        for (int i = 0; i < numberOfAsterisks; i++) {

            for (i = 0; i < numberOfAsterisks; i++) {
                asterisksInRow += "*";
                System.out.println(asterisksInRow);
            }
        }
    }
}
